#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

void func() {
    printf("%f\n", log(exp(2)));
    printf("%f\n", exp(1));
    printf("%d\n", abs(-5));
    printf("%f\n", log2(8));
    printf("%f\n", pow(2, 3));
    char str[11] = "helloworld";
    printf("str : %s\n", str);

}

void swap(int *a, int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}

void reverse(int num){

    printf("%d", num % 10);
    printf("%d", num % 1000 % 100 / 10);
    printf("%d", num % 1000 / 100);
    printf("%d", num / 1000);
    printf("\n");
    
    

}

int main() {
    func();
    int m,n;
    m=30;n=-2;
    do{
        m++; n+=10;
        if(n%3==2)
            printf("%5d%5d\n",m,n); // 右对齐，且显示总字符数为5，不够的用空格替代
    } while(m>n);


    int x = 5, y = 6;
    swap(&x, &y);
    printf("x = %5d, y = %5d", x, y);

    int num;
    scanf("%d", &num);
    reverse(num);

    printf("A = %d, a = %d, '0' = %d\n", 'A', 'a', '0');
    printf("%d\n", 319/4*10);
    printf("%f\n", pow((pow((3-1), 2)+pow((3-1), 2)), 0.5));
    printf("%f\n", sqrt(pow((3-1), 2)+pow((3-1), 2)));
    
    int a = -9;
    do{
        printf("%d", a+=4);
    } while(a++);
    printf("\n");

    union u{
        int x;
        float y;
        char c;
    }U;
    
    printf("%d\n", sizeof(U));
    return 0;
}